package com.qianfeng.Service;

import com.qianfeng.dao.MemberDao;
import com.qianfeng.model.Member;

import java.sql.SQLException;

public class MemberService {
    private MemberDao memberDao=new MemberDao();

    public Member login(String phone,String password) throws Exception {
            Member member=memberDao.getOne(phone);
            if(member==null) {
                throw new Exception("用户名或密码错误");
            }
            if(!member.getPassword().equals(password)){
                throw new Exception("用户名或密码错误");
            }
            return member;
    }

}
